<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>ignore_unused</title>
<link rel="stylesheet" href="../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../index.html" title="Chapter 1. Boost.Core">
<link rel="up" href="../index.html" title="Chapter 1. Boost.Core">
<link rel="prev" href="first_scalar.html" title="first_scalar">
<link rel="next" href="is_same.html" title="is_same">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../boost.png"></td>
<td align="center"><a href="../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="first_scalar.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="is_same.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="core.ignore_unused"></a><a class="link" href="ignore_unused.html" title="ignore_unused">ignore_unused</a>
</h2></div></div></div>
<div class="toc"><dl class="toc">
<dt><span class="section"><a href="ignore_unused.html#core.ignore_unused.header_boost_core_ignore_unused_">Header
      &lt;boost/core/ignore_unused.hpp&gt;</a></span></dt>
<dt><span class="section"><a href="ignore_unused.html#core.ignore_unused.acknowledgments">Acknowledgments</a></span></dt>
</dl></div>
<div class="simplesect">
<div class="titlepage"><div><div><h3 class="title">
<a name="idm7540"></a>Authors</h3></div></div></div>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
          Adam Wulkiewicz
        </li></ul></div>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="core.ignore_unused.header_boost_core_ignore_unused_"></a><a class="link" href="ignore_unused.html#core.ignore_unused.header_boost_core_ignore_unused_" title="Header &lt;boost/core/ignore_unused.hpp&gt;">Header
      &lt;boost/core/ignore_unused.hpp&gt;</a>
</h3></div></div></div>
<p>
        The header <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">core</span><span class="special">/</span><span class="identifier">ignore_unused</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code>
        defines the function template <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">ignore_unused</span><span class="special">()</span></code>. It may be used to suppress the "unused
        variable" or "unused local typedefs" compiler warnings when
        the variable or typedef can't be removed or commented out, e.g. when some
        blocks of the code are conditionally activated. C++11 variadic templates
        are used if they're supported, otherwise they're emulated with overloads.
      </p>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="core.ignore_unused.header_boost_core_ignore_unused_.usage"></a><a class="link" href="ignore_unused.html#core.ignore_unused.header_boost_core_ignore_unused_.usage" title="Usage">Usage</a>
</h4></div></div></div>
<pre class="programlisting"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">ignore_unused</span><span class="special">(</span><span class="identifier">v1</span><span class="special">,</span> <span class="identifier">v2</span><span class="special">,</span> <span class="identifier">v3</span><span class="special">);</span>
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">ignore_unused</span><span class="special">&lt;</span><span class="identifier">T1</span><span class="special">,</span> <span class="identifier">T2</span><span class="special">,</span> <span class="identifier">T3</span><span class="special">&gt;();</span>
</pre>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="core.ignore_unused.header_boost_core_ignore_unused_.example"></a><a class="link" href="ignore_unused.html#core.ignore_unused.header_boost_core_ignore_unused_.example" title="Example">Example</a>
</h4></div></div></div>
<pre class="programlisting"><span class="keyword">int</span> <span class="identifier">fun</span><span class="special">(</span> <span class="keyword">int</span> <span class="identifier">foo</span><span class="special">,</span> <span class="keyword">int</span> <span class="identifier">bar</span> <span class="special">)</span>
<span class="special">{</span>
    <span class="identifier">boost</span><span class="special">::</span><span class="identifier">ignore_unused</span><span class="special">(</span><span class="identifier">bar</span><span class="special">);</span>
<span class="preprocessor">#ifdef</span> <span class="identifier">ENABLE_DEBUG_OUTPUT</span>
    <span class="keyword">if</span> <span class="special">(</span> <span class="identifier">foo</span> <span class="special">&lt;</span> <span class="identifier">bar</span> <span class="special">)</span>
        <span class="identifier">std</span><span class="special">::</span><span class="identifier">cerr</span> <span class="special">&lt;&lt;</span> <span class="string">"warning! foo &lt; bar"</span><span class="special">;</span>
<span class="preprocessor">#endif</span>
    <span class="keyword">return</span> <span class="identifier">foo</span> <span class="special">+</span> <span class="number">2</span><span class="special">;</span>
<span class="special">}</span>
</pre>
</div>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="core.ignore_unused.acknowledgments"></a><a class="link" href="ignore_unused.html#core.ignore_unused.acknowledgments" title="Acknowledgments">Acknowledgments</a>
</h3></div></div></div>
<p>
        <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">ignore_unused</span><span class="special">()</span></code>
        was contributed by Adam Wulkiewicz.
      </p>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2014 Peter Dimov<br>Copyright © 2014 Glen Fernandes<br>Copyright © 2014 Andrey Semashev<p>
        Distributed under the <a href="http://boost.org/LICENSE_1_0.txt" target="_top">Boost
        Software License, Version 1.0</a>.
      </p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="first_scalar.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="is_same.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>
